;
(function() {
	var EventEmitter = require('events').EventEmitter;
	var midEvent = new EventEmitter();
	var classFolderBasePath = __dirname + "/../core/";
	midEvent.Class = {};
	midEvent.Tool = {};

	function delayGetter(obj, name, path) {
		var requirer;
		obj.__defineGetter__(name, function() {
			return requirer || (requirer = require(path));
		})
	};

	function getDefineClass(className) {
		var folderName = className;
		className = className.split(/\./).map(function(key) {
			return key.charAt(0).toUpperCase() + key.substr(1);
		}).join("");
		delayGetter(midEvent.Class, className, classFolderBasePath + folderName + "/_con");
	};
	getDefineClass("ach");
	getDefineClass("pay_ach");
	getDefineClass("bus");
	getDefineClass("user");
	getDefineClass("buff");
	getDefineClass("bus.space");

	delayGetter(midEvent.Tool, "role", __dirname + "/../server/RESTAPI/role");

	module.exports = midEvent;
}());